package com.xyht.sca_s.student_manage_system.modules.appDynamic.controller;


import com.xyht.sca_s.student_manage_system.common.commonReturn.ResponseResult;
import com.xyht.sca_s.student_manage_system.common.desEncodeAndDecode.annotation.SecretBody;
import com.xyht.sca_s.student_manage_system.modules.appDynamic.entity.req.FormDesignSaveReq;
import com.xyht.sca_s.student_manage_system.modules.appDynamic.service.AppControlOrderService;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * <p>
 * 控件顺序表 前端控制器
 * </p>
 *
 * @author XYHT
 * @since 2023-07-26
 */
@RestController
@RequestMapping("/appDynamicForm")
@SecretBody
public class AppControlOrderController {
    @Resource
    private AppControlOrderService appControlOrderService;

//    @ApiModelProperty(value = "保存表单设计")
//    @PostMapping("/saveDesign")
//    public ResponseResult saveFormDesign(@RequestBody FormDesignSaveReq formSaveReq) {
//        return appControlOrderService.saveFormDesign(formSaveReq);
//    }

    @ApiModelProperty(value = "编辑表单设计")
    @PostMapping("/editDesign")
    public ResponseResult editFormDesign(@RequestBody FormDesignSaveReq formSaveReq) {
        return appControlOrderService.editFormDesign(formSaveReq);
    }

    @ApiModelProperty(value = "展示应用控件及配置")
    @GetMapping("/listFormDesign")
    public ResponseResult listFormDesign(@RequestParam(value = "appId") String appId) {
        return appControlOrderService.listFormDesign(appId);
    }
}

